package view;

import javax.swing.JPanel;
import java.awt.Dimension;
import javax.swing.JLabel;
import java.awt.FlowLayout;
import javax.swing.JTextField;
import javax.swing.JButton;

public class NewBookingDisplay extends JPanel {

	private static final long serialVersionUID = 1L;
	private JLabel jLabel = null;
	private JTextField jTextField = null;
	private JButton jButton = null;
	private SchedulerFrame scheduler = null;  //  @jve:decl-index=0:
	/**
	 * This is the default constructor
	 */
	public NewBookingDisplay() {
		super();
		initialize();
	}

	public NewBookingDisplay(SchedulerFrame scheduler) {
		super();
		initialize();
		setScheduler(scheduler); 
	}

	public SchedulerFrame getScheduler() {
		return scheduler;
	}

	public void setScheduler(SchedulerFrame scheduler) {
		this.scheduler = scheduler;
	}

	/**
	 * This method initializes this
	 * 
	 * @return void
	 */
	private void initialize() {
		jLabel = new JLabel();
		jLabel.setText("Tid");
		this.setSize(623, 305);
		this.setLayout(new FlowLayout());
		this.add(jLabel, null);
		this.add(getJTextField(), null);
		this.add(getJButton(), null);
	}

	/**
	 * This method initializes jTextField	
	 * 	
	 * @return javax.swing.JTextField	
	 */
	private JTextField getJTextField() {
		if (jTextField == null) {
			jTextField = new JTextField();
			jTextField.setPreferredSize(new Dimension(100, 20));
		}
		return jTextField;
	}

	/**
	 * This method initializes jButton	
	 * 	
	 * @return javax.swing.JButton	
	 */
	private JButton getJButton() {
		if (jButton == null) {
			jButton = new JButton();
			jButton.setText("Boka");
			jButton.addActionListener(new java.awt.event.ActionListener() {
				public void actionPerformed(java.awt.event.ActionEvent e) {
					getScheduler().itemStateChanged(SchedulerFrame.DoubleBookedDisplay);
					
				}
			});
		}
		return jButton;
	}

	public void showNewbookingDisplay(){

	}

}  //  @jve:decl-index=0:visual-constraint="10,10"
